// var reg = /\d{3,6}?/g

// var text = '1245454'
// var result = text.replace(reg, "X")
// console.log(result)

var reg = /(\d{4})-(\d{2})-(\d{2})/g
var text = '2018-12-26'
console.log(text.replace(reg, '$2/$3/$1'))



/**
 * 
 * 
 * 
 * 
 */